package com.fourforfo.fourmall.ware.config;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @program: xxl-sso-core
 * @description: 自定义RabbitMQ的配置，设置编码方式等
 * @author: fourforfo
 * @email: fourforfo@gmail.com
 * @create: 2022-08-29 20:14
 **/
@EnableRabbit
@Configuration
public class MyRabbitConfig {

    /**
     * 设置编码格式为Json
     * @return
     */
    @Bean
    public MessageConverter messageConverter(){
        return new Jackson2JsonMessageConverter();
    }



}
